package com.yiji.fintech.musfinance.common.strategy.base;

import com.yiji.fintech.musfinance.common.domain.base.BaseDomain;
import com.yiji.fintech.musfinance.common.domain.channel.ChannelDomain;

/**
 * 规则策略Base
 * Created by ouwen@yiji.com} on 2017/9/22.
 */
public abstract class AbstractRulesStrategy {
    public void doExcute(ChannelDomain channelDomain,BaseDomain domain){
        process(channelDomain);//处理规则
        buildchannel(channelDomain,domain);//构建渠道
        converter(channelDomain,domain);//ChannelDomain转换Domain
    }

    /**
     * 渠道构建
     * @param channelDomain
     * @param domain
     */
    protected abstract void buildchannel(ChannelDomain channelDomain, BaseDomain domain);

    /**
     * 渠道doman转换业务领域domain
     * @param channelDomain
     * @param domain
     */
    protected abstract void converter(ChannelDomain channelDomain, BaseDomain domain);

    /**
     * 执行策略
     * @param domain
     */
    protected abstract void process(ChannelDomain domain);
}
